<script setup lang="ts">
import type { h } from 'vue'
import { type ComponentConfig } from '../../dsl/DslType'
// 显式声明属性
defineProps<{ com: ComponentConfig }>()
</script>
<template>
  <component :is="com?.component" v-bind="com?.props" v-on="com?.events">
    <template v-for="(slot, index) in com?.slots" :key="index" #[slot.name]>
      {{ slot.content }}
    </template>
    <RecursiveComponent
      v-for="(item, index) in com?.children"
      :key="index"
      :com="item"
    ></RecursiveComponent>
  </component>
</template>

<style scoped></style>
